<?php

namespace App\Exports;



use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithCustomQuerySize;
class OnTheJobExport implements FromArray,WithHeadings,ShouldAutoSize,WithCustomQuerySize
{
    use Exportable;
    protected $invoices;
    protected $header;
    protected $count;
    public function __construct(array $invoices,array $header,int $count)
    {
        $this->invoices = $invoices;
        $this->header = $header;
        $this->count = $count;

    }
    public function querySize(): int
    {
       // $query = //......

        //$size = $query->count();
        return $this->count;
    }
    /**
     * @var Invoice $invoice
     */
    public function array(): array
    {
        return $this->invoices;
    }
    public function headings(): array
    {
        return $this->header;
    }

}
